package com.atguigu.spring5;/*
@author joker
@create 2022-03-16 9:09
untitled
*/

import java.awt.image.BandCombineOp;

public class Book {
    private String bname;
    private String author;
    private String address;



    public Book() {
    }

    @Override
    public String toString() {
        return "Book{" +
                "bname='" + bname + '\'' +
                ", author='" + author + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    public Book(String bname) {
        this.bname = bname;
    }

    public String getBname() {
        return bname;
    }

    public String getAuthor() {
        return author;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    //这里就是使用第一种方法,使用set方法注入
    public void setBname(String bname) {
        this.bname = bname;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void testDemo(){
        System.out.println("name = " + bname + "\t" +"author = " + author);
    }

}
